package com.example.yin.event;

import com.example.yin.service.OssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class OssUploadlListener {

    @Autowired
    private OssService ossService;

    @EventListener
    @Async
    public void OssUpdate(UploadMessage event) {
        ossService.uploadFile(event.getFile(), event.getFilepath());
    }


}
